package com.health.userbackstage.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

import javax.print.attribute.standard.PrinterURI;
import java.text.SimpleDateFormat;

/**
 * @Author ASUS
 * @Date 2023/8/22 9:44
 * @Version 1.0
 */
@Configuration
@EnableTransactionManagement
public class ApplicationConfig {

    @Bean
    public SimpleDateFormat simpleDateFormat(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf;
    }

    @Bean
    public CommonsMultipartResolver multipartResolver(){
        CommonsMultipartResolver  commonsMultipartResolver= new CommonsMultipartResolver();
        commonsMultipartResolver.setMaxUploadSize(2100000);
        commonsMultipartResolver.setMaxUploadSizePerFile(2100000);
        return commonsMultipartResolver;
    }
}
